using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class so_AllAppStatMap : EntityTypeConfiguration<so_AllAppStat>
    {
        public so_AllAppStatMap()
        {
            // Primary Key
            this.HasKey(t => new { t.Appointments_status, t.sumfields, t.dimfields });

            // Properties
            this.Property(t => t.Physician_Name)
                .HasMaxLength(35);

            this.Property(t => t.Appointments_status)
                .IsRequired()
                .HasMaxLength(11);

            this.Property(t => t.Operation)
                .IsFixedLength()
                .HasMaxLength(6);

            this.Property(t => t.Month)
                .HasMaxLength(2);

            this.Property(t => t.Year)
                .HasMaxLength(4);

            this.Property(t => t.sumfields)
                .IsRequired()
                .HasMaxLength(24);

            this.Property(t => t.dimfields)
                .IsRequired()
                .HasMaxLength(57);

            // Table & Column Mappings
            this.ToTable("so_AllAppStat");
            this.Property(t => t.Physician_Name).HasColumnName("Physician_Name");
            this.Property(t => t.Number_of_Appointments).HasColumnName("Number_of_Appointments");
            this.Property(t => t.Appointments_status).HasColumnName("Appointments_status");
            this.Property(t => t.Operation).HasColumnName("Operation");
            this.Property(t => t.Month).HasColumnName("Month");
            this.Property(t => t.Year).HasColumnName("Year");
            this.Property(t => t.sumfields).HasColumnName("sumfields");
            this.Property(t => t.dimfields).HasColumnName("dimfields");
        }
    }
}
